﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using OLTS.WEB.BaseClass;
using OLTS.DATA_SERVICE;
namespace ONTS.WEB.UserControl
{
    public partial class uc_UserInfo : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            String idEmp = BaseService.LOGIN.EMPLOYEE_ID;
            if (idEmp == string.Empty || idEmp == "admin")
            {
                idEmp = Request.QueryString["id"].ToString();
            }
            var cmd = new Employee_Service(idEmp);
            var result = cmd.GetByEmpId();
            
            var cmdAsSign = new AsSignProject_Service(idEmp);
            var resultAsSgin = cmdAsSign.GetByEmpId();

            if (resultAsSgin!= null)
            {
                var cmdSite = new Site_Service(Convert.ToInt16(resultAsSgin.OTS_PROJECT.SITE_ID));
                var resultSite = cmdSite.GetByIdSite();

                lblNameEN.InnerText = result.NAME_EN;
                lblNameTH.InnerText = result.NAME_TH;
                lblSiteName.InnerText = resultSite.NAME;
                lblPosition.InnerText = result.POSITION;
            }
            
        }
    }
}